<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" errorPage="500.jsp"%>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>后台管理</title>
<link rel="stylesheet" href="../admin_css/userShow.css">
<link rel="stylesheet" href="../admin_css/iconfont/iconfont.css">
</head>
<script type="text/javascript" src="../js/jquery-1.12.4.js"></script>
<body>
<div class="content">
    <div class="container" style="padding: 0px;width: 100% ;display:"none";">
    <div class="tou"><span class="iconfont icon-paidui"></span><span style="font-weight: bold; margin-left: 6px;">用户信息管理</span></div>
    <table class="table">
        <caption><span id="sum" style="margin-left: 30px;">共${userreviewSize}条</span></caption>
        <thead>
        <tr>
            <th>用户ID</th>
            <th>头像</th>
            <th>用户名</th>
            <th>密码</th>
            <th>电话号码</th>
            <th>昵称</th>
            <th>性别</th>
            <th>生日</th>
            <th>生活状态</th>
            <th>职业</th>
            <th>个性签名</th>
        </tr>
        </thead>
        <tbody id="table">
            <c:if test="${!empty userreviews}">
                <c:forEach items="${userreviews}" var="user">
                    <tr>
                        <td>${user.uId}</td>
                        <td><img src="../${user.uImg}"></td>
                        <td>${user.uName}</td>
                        <td>${user.uPassword}</td>
                        <td>${user.uPhoneNum}</td>
                        <td>${user.uNickName}</td>
                        <td>${user.uSex}</td>
                        <td>${user.uBirthday}</td>
                        <td>${user.uLiftState}</td>
                        <td>${user.uIndustry}</td>
                        <td id="userSign">${user.uSignature}</td>
                    </tr>
                </c:forEach>
            </c:if>
        </tbody>
    </table>
    <!--分页-->
    <div id="fenye" class="panel-footer" style="text-align: center; display: block;">
        <nav style="height: 35px;">
            <ul class="pagination" style="margin-top:0px;">
                <li id="Previous" class="disabled" style="cursor: pointer;" flag="">
                      <span aria-hidden="true">«</span>    
                </li>
                

                <c:forEach items="${userreview}" begin="0" end="${userreviewSize<=7?0:(userreviewSize/7)}" varStatus="temp">               
               		<li flag="${temp.count}" class="${param.flag==temp.count?'active':''} data"><a href="${pageContext.request.contextPath}/UserTypePage.do?page=${temp.count}">${temp.count}</a></li>
               </c:forEach>
               <li id="li" style="cursor: pointer;">             
                      <span aria-hidden="true">»</span>
                </li>
            </ul>
        </nav>
        <div class="clearfix"></div>
    </div>
    <!--添加弹出框 -->
    <div class="modal fade" id="add" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true" style="display: none;">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                    <h4 class="modal-title" id="myModalLabel" style="text-align: center;">电影信息添加</h4>
                </div>
                <div class="text-center" style="margin-top: 15px; text-align: center;">
                    <div class="form-group">
                        <label for="firstname" class="col-sm-3 control-label">电影名称</label>
                        <div class="">
                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;">
                        </div>
                    </div>
                     <div class="form-group">
                        <label for="firstname" class="col-sm-3 control-label">电影英文名</label>
                        <div class="">
                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;">
                        </div>
                    </div>
                     <div class="form-group">
                        <label for="firstname" class="col-sm-3 control-label">电影产地</label>
                        <div class="">
                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;">
                        </div>
                    </div>
                     <div class="form-group">
                        <label for="firstname" class="col-sm-3 control-label">电影语言</label>
                        <div class="">
                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="firstname" class="col-sm-3 control-label">电影图片</label>
                        <div class="">
                            <input type="file" style="margin-left: 0px; display: inherit;width: 230px;" id="posterUrl2">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="firstname" class="col-sm-3 control-label">电影类型</label>
                        <div class="">
                            <select id="select" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" name="">
                                
                                    <option value="1">动作</option>
                                
                                    <option value="2">爱情</option>
                                
                                    <option value="3">谍战</option>
                                
                                    <option value="7">悬疑</option>
                                
                                    <option value="8">侦探</option>
                                
                                    <option value="9">科幻</option>
                                
                                    <option value="10">战争</option>
                                
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="firstname" class="col-sm-3 control-label">电影导演</label>
                        <div class="">
                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" id="director2">
                        </div>
                    </div>
                  
                    <div class="form-group">
                        <label for="firstname" class="col-sm-3 control-label">电影演员</label>
                        <div class="">
                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" id="star2">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="firstname" class="col-sm-3 control-label">电影首映时间</label>
                        <div class="">
                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;" id="filmName2">
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="firstname" class="col-sm-3 control-label">片长</label>
                        <div class="">
                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;">
                        </div>
                    </div>
                     <div class="form-group">
                        <label for="firstname" class="col-sm-3 control-label">电影描述</label>
                        <div class="">
                            <input type="text" class="form-control" style="margin-left: 0px; display: inherit;width: 230px;">
                        </div>
                    </div>
                </div>
                <div class="modal-footer" style="text-align: center;">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button id="but4" type="button" class="btn btn-danger" data-dismiss="modal">添加</button>
                </div>
            </div>
            <!-- /.modal-content -->
        </div>
        <!-- /.modal-dialog -->
    </div>
</div>
</div>
</body>
<script>
    $("#Previous").click(function() {
    	var firstPage = $(".pagination>li.active").prev().find("a").eq(0).html();
		var first = $(".pagination .data:first a").html();
		var activepage = $(".pagination .active a").html();
        if(first==activepage){
            alert("已经是第一页了");
        }else{
        	 window.location.href="/film/UserTypePage.do?page="+firstPage;
        }
    });

    $("#li").click(function(){
    	var lastPage = $(".pagination>li.active").next().find("a").eq(0).html();
		var first = $(".pagination .data:last a").html();
		var activepage = $(".pagination .active a").html();
        if(first==activepage){
            alert("已经是最后一页了");
        }else{
        	window.location.href="/film/UserTypePage.do?page="+lastPage;
        }
    });
</script>
</html>